package cn.texous.demo.demojvm.list;

import java.util.UUID;

/**
 * insert description here.
 *
 * @author Showa.L
 * @since 2019/11/14 14:18
 */
public class TestSprit {

    public static void main(String[] args) {
        String click = "http://www.dd.com?click_id=%s&request_id=123";
        String requestId = "123456";
        for (int i = 0; i < 100; i++) {
            String ocId = UUID.randomUUID().toString();
            String clickUrl = String.format(click, ocId);
            System.out.println(clickUrl);
            if (clickUrl.contains("click_id")) {
                clickUrl = clickUrl.replaceFirst("click_id=[\\w\\-]+", "click_id=" + requestId);
            } else {
                clickUrl = clickUrl.concat("&click_id=").concat(requestId);
            }
            System.out.println(clickUrl);
        }
    }

}
